<?php
/**@var \Weline\Framework\View\Template $this */
/**@var \Weline\Backend\Block\ThemeConfig $themeConfig */
$themeConfig = \Weline\Framework\Manager\ObjectManager::getInstance(\Weline\Backend\Block\ThemeConfig::class);
?>
<!DOCTYPE html>
<!--
 *@Author       秋枫雁飞
 *@Email        aiweline@qq.com
 *@Forum        https://bbs.aiweline.com
 *@DESC         后台共用头部
-->
<html lang="en" <?= ('rtl' === $themeConfig->getThemeModel()) ? " dir=\"rtl\"" : '' ?>>
<head>
    <w:template>Weline_Admin::common/head.phtml</w:template>
    <!-- jvectormap -->
    <link href="@static(Weline_Admin::assets/libs/jqvmap/jqvmap.min.css)" rel="stylesheet"/>
    <title><lang>Weline Admin 管理面板</lang></title>
</head>

<!--<body data-sidebar="dark" data-topbar='colored' data-layout='horizontal'>-->
<body <?= $themeConfig->getLayouts() ?? ''; ?>>
<!-- <body data-layout="horizontal" data-topbar="dark"> -->
<!--加载中组件 开始-->
<w:template>Weline_Admin::common/page/loading.phtml</w:template>
<!-- 开始 页面 -->
<div id="layout-wrapper">

    <!--页头工具条 开始-->
    <w:block class='Weline\Admin\Block\Backend\Page\Topbar'/>
    <!--页头工具条 结束-->

    <!-- ========== Topnav Start ========== -->
    <!--页头菜单栏 开始-->
    <w:block class='Weline\Admin\Block\Backend\Page\Topnav'/>
    <!--页头菜单栏 结束-->

    <!-- ========== Left Sidebar Start ========== -->
    <!--左侧菜单栏 开始-->
    <w:template>Weline_Admin::common/left-sidebar.phtml</w:template>
    <!--左侧菜单栏 结束-->


    <!-- ============================================================== -->
    <!-- Start right Content here -->
    <!-- ============================================================== -->
    <div class='main-content'>
        <div class='page-content'>
            <div class='container-fluid'>
                <div class='row'>
                    <!--消息-->
                    <template>Weline_Component::message.phtml</template>
                </div>
                <!-- start page title -->
                <div class='row'>
                    <div class='col-12'>
                        <div class='page-title-box d-sm-flex align-items-center justify-content-between'>
                            <h4 class='mb-sm-0'>
                                <lang>Ai generator for Magento 2 - review listings</lang>
                            </h4>
                            <div class='page-title-right'>
                                <breadcrumb model="Weline\Backend\Model\Menu"
                                            id_field="menu_id"
                                            parent_field="pid"
                                            order_field="order"
                                            name_field="title"
                                />
                            </div>

                        </div>
                    </div>
                </div>
                <!-- end page title -->
                <!-- start page message -->
                <div class='row'>
                    <template>Weline_Component::message.phtml</template>
                </div> <!-- end message -->
                <div class="row">
                    <div class="col-12">
                        <div class="card">
                            <div class="card-body">
                                <h4 class="card-title">
                                    <lang>Ai review listings</lang>
                                </h4>
                                <div class="card-title-desc">

                                </div>
                                <!--<div class="table-responsive mCustomScrollbar" data-mcs-axis="yx" data-mcs-theme='dark'
                                     style="height: 800px">-->
                                <div class='table-responsive mCustomScrollbar' data-mcs-axis='x'
                                     data-mcs-theme='dark'>
                                    <table class="table table-editable table-nowrap align-middle table-edits">
                                        <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>
                                                <lang>Magento store id</lang>
                                            </th>
                                            <th>
                                                <lang>Sku</lang>
                                            </th>
                                            <th>
                                                <lang>nickname</lang>
                                            </th>
                                            <th>
                                                <lang>title</lang>
                                            </th>
                                            <th>
                                                <lang>detail</lang>
                                            </th>
                                            <th>
                                                <lang>rating</lang>
                                            </th>
                                            <th>
                                                <lang>created_at</lang>
                                            </th>
                                            <th>
                                                <lang>Action</lang>
                                            </th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <foreach name="reviews">
                                            <tr data-id='{{v.id}}'>
                                                <td data-field='id'>{{v.id}}</td>
                                                <td data-field='id'>{{v.store_id}}</td>
                                                <td data-field='id'>{{v.product_sku}}</td>
                                                <td data-field='id'>{{v.nickname}}</td>
                                                <td data-field='id'>{{v.title}}</td>
                                                <td data-field='id'>{{v.detail}}</td>
                                                <td data-field='id'>{{v.rating}}</td>
                                                <td data-field='id'>{{v.created_at}}</td>
                                            </tr>
                                        </foreach>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <var>pagination</var>
                    </div> <!-- end col -->
                </div>
                <!-- end row -->

            </div>
            <!-- container-fluid -->
        </div>
        <!-- End Page-content -->

        <footer class='footer'>
            <div class='container-fluid'>
                <div class='row'>
                    <div class='col-sm-6'>
                        <script>document.write(new Date().getFullYear())</script>
                        © Weline.
                    </div>
                    <div class='col-sm-6'>
                        <div class='text-sm-end d-none d-sm-block'>
                            Crafted with <i class='mdi mdi-heart text-danger'></i> By <a
                                    href='https://www.aiweline.com/'>秋枫雁飞(aiweline)</a>
                        </div>
                    </div>
                </div>
            </div>
        </footer>

    </div>
    <!-- end main content-->

</div>
<!-- END layout-wrapper -->

<!--右边栏-->
<w:template>Weline_Admin::common/right-sidebar.phtml</w:template>
<script>
    // productImage 点击放大
    var productImage = $('.productImage');
    productImage.click(function () {
        var src = $(this).attr('src');
        var img = '<img src="' + src + '" style="width: 100%;height: 100%;">';
        // 原生js放大
        var div = document.createElement('div');
        div.innerHTML = img;
        div.style.position = 'fixed';
        div.style.top = '0';
        div.style.left = '0';
        div.style.width = '50%';
        div.style.height = '50%';
        div.style.backgroundColor = 'rgba(0,0,0,0.8)';
        div.style.zIndex = '9999';
        div.style.display = 'flex';
        div.style.justifyContent = 'center';
        div.style.alignItems = 'center';
        div.style.flexDirection = 'column';
        div.style.cursor = 'pointer';
        div.onclick = function () {
            div.remove();
        }
        document.body.appendChild(div);
        div.onmousewheel = function (e) {
            e.preventDefault();
        }
        div.onkeydown = function (e) {
            if (e.keyCode === 27) {
                div.remove();
            }
        }
    })
</script>
<!-- jquery.vectormap map -->
<w:js>Weline_Admin::assets/libs/jqvmap/jquery.vmap.min.js</w:js>
<w:js>Weline_Admin::assets/libs/jqvmap/maps/jquery.vmap.usa.js</w:js>
<w:js>Weline_Admin::assets/libs/jqvmap/maps/jquery.vmap.usa.js</w:js>
<js:part name="w-delete"/>
<!--页脚-->
<w:template>Weline_Admin::common/footer.phtml</w:template>
</body>
</html>

